
#include "core/components_ng/pattern/mycircle/mycircle_model_ng.h"

#include "core/components_ng/base/frame_node.h"
#include "core/components_ng/base/view_stack_processor.h"
#include "core/components_ng/pattern/mycircle/mycircle_pattern.h"
#include "core/components_v2/inspector/inspector_constants.h"
#include "core/pipeline_ng/pipeline_context.h"

namespace OHOS::Ace::NG {
void MyCircleModelNG::Create()
{
    auto* stack = ViewStackProcessor::GetInstance();
    auto nodeId = stack->ClaimNodeId();
    auto frameNode = FrameNode::GetOrCreateFrameNode(
        V2::MYCIRCLE_ETS_TAG, nodeId, []() { return AceType::MakeRefPtr<MyCirclePattern>(); });
    stack->Push(frameNode);
}

void MyCircleModelNG::SetRadius(const Dimension& value)
{
    ACE_UPDATE_LAYOUT_PROPERTY(MyCircleLayoutProperty, Radius, value);
}

void MyCircleModelNG::SetEdgeColor(const Color& value)
{
    ACE_UPDATE_PAINT_PROPERTY(MyCirclePaintProperty, EdgeColor, value);
}

void MyCircleModelNG::SetEdgeWidth(const Dimension& value)
{
    ACE_UPDATE_LAYOUT_PROPERTY(MyCircleLayoutProperty, EdgeWidth, value);
}
} // namespace OHOS::Ace::NG
